<template>
	<view class="user-center">
		<view v-if="CurrentClient === 0" class="bg-fa">
			<!-- 用户端  用户中心 -->
			<u-navbar leftIconSize="0" :placeholder="false" bgColor="rgba(255,255,255,0)">
				<view slot="center">
					<text class="c-333 pf-sc fw-500" style="font-size: 34rpx;">我的</text>
				</view>
			</u-navbar>
			<!-- bg -->
			<view
				class="authentication-container w-750 b-box po-re"
				style="z-index: 12;background-color: rgba(255,255,255,0);"
				:style="{ height: containerHeight }"
			>
				<view
					class="bg po-re"
					style="top:0;left: 0;right: 0;width: 750rpx;height:560rpx;z-index: 1;background-color: rgba(255,255,255,0);"
				>
					<image
						:src="require('@/static/usermodel/bgc.png')"
						style="width: 750rpx;height: 560rpx;"
					></image>
				</view>
				<!-- -->
				<view
					class="w-100 b-box po-ab"
					:style="{ height: userContainer, top: containerTop }"
					style="z-index: 11;padding-top: 30rpx;"
				>
					<scroll-view scroll-y="true" :style="{ height: userContainer }">
						<view style="padding: 0 24rpx;" class="d-flex flex-c ali-i-c just-s">
							<!-- 1 -->
							<view
								class="w-100 b-box d-flex flex-c ali-i-e just-s"
								style="height: 200rpx;padding: 0 16rpx;"
								@click.stop="GoSetDataByUser"
							>
								<view
									class="w-100 b-box d-flex flex-r ali-i-s just-s"
									style="height: 104rpx;"
									@click="GoSetDataByUser"
								>
									<view
										style="width: 104rpx;height:104rpx;border-radius:200rpx;overflow: hidden;margin-bottom: 10rpx;margin-right: 12rpx;"
									>
										<!-- 头像 -->
										<image
											:src="'https://www.chejingjing.cn' + userInfo.avatar"
											style="width: 104rpx;height:104rpx"
										></image>
									</view>
									<view style="flex: 1;height: 104rpx;" class="d-flex flex-r ali-i-c just-sw">
										<view class="d-flex flex-c ali-i-c just-sw" style="height: 90rpx;">
											<text class="">{{ userInfo.nickname ? userInfo.nickname : '请登录' }}</text>
											<!-- 这里判断level的等级来显示对应的图片 目前没有图片  后期更换 -->
											<image
												v-if="userInfo.level"
												:src="require('@/static/jrjsk2.png')"
												style="width: 178rpx;height: 41rpx;"
												@click.stop="goMember"
											></image>

											<image
												:src="require('@/static/kt.png')"
												style="width: 154rpx;height: 39rpx;"
												v-if="!userInfo.level"
												@click.stop="goIndex"
											></image>
										</view>
										<view
											class="d-flex flex-c ali-i-c just-s"
											style="margin-right: 10rpx;position: relative;"
											@click.stop="goMessage"
										>
											<image
												:src="require('@/static/xiaoxi.png')"
												style="width: 41rpx;height: 38rpx;"
											></image>
											<image
												v-if="xxnum > 0"
												:src="require('@/static/hongdian.png')"
												style="width: 20rpx;height: 20rpx;position: absolute;right: -14rpx;top: -10rpx;"
											></image>
										</view>
									</view>
								</view>
								<!--  -->
								<view
									v-if="userInfo"
									class="d-flex b-box flex-r ali-i-c just-s"
									style="width:566rpx ;flex:1;margin-top: -4px;margin-left: 10px;"
								>
									<text
										class="pf-sc fw-400"
										style="font-size: 26rpx;color: #262626;"
										@click="GoRemainingSum"
									>
										余额
									</text>
									<text
										class="pf-sc fw-500"
										style="font-size: 34rpx;color: #262626;"
										@click="GoRemainingSum"
									>
										￥{{ userInfo.money }}
									</text>
								</view>
							</view>
							<!-- box -->
							<view
								class="w-100 b-box bg-fa"
								style="border-radius: 16rpx;overflow: hidden;flex: 1;"
							>
								<!-- 1-->
								<view
									class="w-100 b-box bg-ff d-flex flex-c ali-i-s just-s"
									style="height: 224rpx;padding: 24rpx 32rpx;border-radius: 16rpx;overflow: hidden;"
								>
									<text class="c-000 pf-sc fw-500" style="font-size: 34rpx;margin-bottom: 46rpx;">
										我的订单
									</text>
									<view class="b-box d-flex flex-r ali-i-c just-c w-100" style="height: 58rpx;">
										<view
											class="d-flex flex-r ali-i-c just-c"
											style="border-right: 1rpx solid #E2E2E2;flex: 1;"
											@click="GoServiceOrder"
										>
											<image
												:src="require('@/static/usermodel/icon10.png')"
												style="width: 54rpx;height: 50rpx;margin-right: 18rpx;"
											></image>
											<text
												class="c-333 pf-sc fw-500"
												style="font-size: 28rpx;margin-right: 26rpx;"
											>
												服务订单
											</text>
										</view>
										<view
											class="d-flex flex-r ali-i-c just-c"
											style="flex: 1;"
											@click="GoShopOrder"
										>
											<image
												:src="require('@/static/usermodel/icon11.png')"
												style="width: 54rpx;height: 50rpx;margin:0 18rpx 0 50rpx;"
											></image>
											<text class="c-333 pf-sc fw-500" style="font-size: 28rpx;">商城订单</text>
										</view>
									</view>
								</view>
								<!--2  -->
								<view
									class="d-flex flex-c ali-i-c just-c b-box w-100 po-re"
									style="top:28rpx;height: 460rpx;"
								>
									<view
										class="w-100 b-box bg-ff d-flex flex-r ali-i-c po-re"
										style="height: 184rpx;width: 100%;justify-content: space-between;"
									>
										<view
											class="d-flex flex-c ali-i-c just-c"
											style="height: 114rpx;width: 25%;"
											@click="GoVehicleManagement"
										>
											<image
												:src="require('@/static/usermodel/icon12.png')"
												style="width: 52rpx;height: 44rpx;margin-bottom: 20rpx;"
											></image>
											<text class="fw-400 pf-sc" style="font-size: 28rpx;color: #26387C;">
												车辆管理
											</text>
										</view>
										<view
											class="d-flex flex-c ali-i-c just-c"
											style="height: 114rpx;width: 25%;"
											@click="GoMyCouPon"
										>
											<image
												:src="require('@/static/usermodel/icon13.png')"
												style="width: 50rpx;height: 44rpx;margin-bottom: 20rpx;"
											></image>
											<text class="fw-400 pf-sc" style="font-size: 28rpx;color: #26387C;">
												我的优惠券
											</text>
										</view>
										<view
											class="d-flex flex-c ali-i-c just-c"
											style="height: 114rpx;width: 25%;"
											@click="GoRecharge"
										>
											<image
												:src="require('@/static/usermodel/icon14.png')"
												class="po-re"
												style="width: 49rpx;height: 49rpx;margin-bottom: 15.5rpx;top:-2rpx"
											></image>
											<text class="fw-400 pf-sc" style="font-size: 28rpx;color: #26387C;">
												优惠充值
											</text>
										</view>
										<view
											class="d-flex flex-c ali-i-c just-c"
											style="height: 114rpx;width: 25%;"
											@click="GoMembershipCard"
										>
											<image
												:src="require('@/static/usermodel/icon15.png')"
												class="po-re"
												style="width: 53rpx;height: 38rpx;margin-bottom: 25rpx;top:4rpx"
											></image>
											<text class="fw-400 pf-sc" style="font-size: 28rpx;color: #26387C;">
												我的会员卡
											</text>
										</view>
									</view>
									<!-- 第二行 -->
									<view
										class="w-100 b-box bg-ff d-flex flex-r ali-i-c  po-re"
										style="height: 184rpx;justify-content: space-between;width: 100%;"
									>
										<view
											class="d-flex flex-c ali-i-c just-c"
											style="height: 114rpx;width: 25%;"
											@click="GoMyTeam"
										>
											<image
												:src="require('@/static/usermodel/icon16.png')"
												style="width: 52rpx;height: 52rpx;margin-bottom: 16rpx;"
											></image>
											<text class="fw-400 pf-sc" style="font-size: 28rpx;color: #26387C;">
												我的团队
											</text>
										</view>

										<view
											class="d-flex flex-c ali-i-c just-c"
											style="height: 114rpx;width: 25%;"
											@click="GoShareRewards"
										>
											<image
												:src="require('@/static/usermodel/icon17.png')"
												style="width: 47rpx;height: 50rpx;margin-bottom: 18rpx;"
											></image>
											<text class="fw-400 pf-sc" style="font-size: 28rpx;color: #26387C;">
												分享奖励
											</text>
										</view>

										<view
											class="d-flex flex-c ali-i-c just-c"
											style="height: 114rpx;width: 25%;"
											@click="GoShoppingCard"
										>
											<image
												:src="require('@/static/usermodel/icon18.png')"
												style="width: 41rpx;height: 46rpx;margin-bottom: 22rpx;"
											></image>
											<text class="fw-400 pf-sc" style="font-size: 28rpx;color: #26387C;">
												购物车
											</text>
										</view>

										<view
											class="d-flex flex-c ali-i-c just-c"
											style="height: 114rpx;width: 25%;"
											@click="GoAddressList"
										>
											<image
												:src="require('@/static/usermodel/icon19.png')"
												style="width: 46rpx;height: 48rpx;margin-bottom: 20rpx;"
											></image>
											<text class="fw-400 pf-sc" style="font-size: 28rpx;color: #26387C;">
												收货地址
											</text>
										</view>
									</view>

									<!-- 第三行 -->
									<view
										class="w-100 b-box bg-ff d-flex flex-r ali-i-s  po-re"
										style="height: 215rpx;width: 100%;"
									>
										<view
											class="d-flex flex-c ali-i-c just-c"
											style="height: 114rpx;width: 25%;"
											@click="GoLogOn"
										>
											<image
												:src="require('@/static/shifu.png')"
												style="width: 47rpx;height: 50rpx;margin-bottom: 18rpx;"
											></image>
											<text class="fw-400 pf-sc" style="font-size: 28rpx;color: #26387C;">
												师傅登录
											</text>
										</view>

										<view
											class="d-flex flex-c ali-i-c just-c"
											style="height: 114rpx;width: 25%;"
											@click="GoShenQing"
										>
											<image
												:src="require('@/static/hehuoren.png')"
												style="width: 47rpx;height: 50rpx;margin-bottom: 18rpx;"
											></image>
											<text class="fw-400 pf-sc" style="font-size: 28rpx;color: #26387C;">
												合伙人申请
											</text>
										</view>

										<view
											class="d-flex flex-c ali-i-c just-c"
											style="height: 114rpx;width: 25%;"
											@click="GoShenLogin"
										>
											<image
												:src="require('@/static/shen.png')"
												style="width: 47rpx;height: 50rpx;margin-bottom: 18rpx;"
											></image>
											<text class="fw-400 pf-sc" style="font-size: 28rpx;color: #26387C;">
												年审人员登录
											</text>
										</view>
									</view>
								</view>
							</view>
						</view>
					</scroll-view>
				</view>
				<!--  -->
			</view>
		</view>

		<!-- 师傅  用户中心 -->
		<view v-else-if="CurrentClient === 1" class="bg-fa">
			<!-- 师傅  用户中心 -->
			<u-navbar leftIconSize="0" :placeholder="true" bgColor="rgba(255,255,255,0)">
				<view class="" slot="center">
					<text class="c-000 pf-sc fw-600" style="font-size: 34rpx;">我的</text>
				</view>
			</u-navbar>
			<view class="bg w-750 b-box po-fx" style="top: 0;right: 0;left: 0;z-index: 10;"></view>
			<view
				v-if="workUser"
				class="user-center-container w-750 b-box   po-re"
				style="z-index: 15;background-color: rgba(255,255,255,0);padding: 0 24rpx;"
				:style="{ height: containerHeight }"
			>
				<!-- 1 -->
				<view
					style="height: 200rpx;padding: 0 40rpx;margin-bottom: 20rpx;"
					class="d-flex flex-r b-box ali-i-c just-s bg w-750"
				>
					<view
						style="width: 104rpx;height: 104rpx;border-radius: 200rpx;overflow: hidden;margin-right: 24rpx;"
					>
						<image :src="workUser.avatar" style="width: 104rpx;height: 104rpx;"></image>
					</view>
					<!--  -->
					<view style="height: 98rpx;flex: 1;" class="d-flex flex-r ali-i-c just-sw">
						<view style="height: inherit;" class="d-flex flex-c ali-i-s just-sw">
							<view class=" d-flex flex-r ali-i-c just-s ">
								<text class="c-333 pf-sc fw-500" style="margin-right: 4rpx;font-size: 33rpx;">
									{{ workUser.nickname }}
								</text>
								<image
									:src="require('@/static/star.png')"
									style="width: 28rpx;height: 28rpx;"
								></image>
								<text
									class=" pf-sc fw-400"
									style="margin-right: 4rpx;font-size: 24rpx;color: #F3B100;"
								>
									5.0
								</text>
							</view>
							<text class="c-333 pf-sc fw-400" style="font-size: 28rpx;">
								{{ workUser.shopname ? workUser.shopname : '暂未加入门店' }}
							</text>
						</view>
						<view
							style="width: 30rpx;height: 30rpx;right:16rpx"
							class="po-re d-flex flex-r ali-i-c just-e"
							@click="GoSetDataByStaff"
						>
							<image
								:src="require('@/static/icon/right.png')"
								style="width: 15rpx;height: 26rpx;"
							></image>
						</view>
					</view>
				</view>
				<!-- 2 -->
				<view
					class="w-100 d-flex flex-r ali-i-c just-ev bg-ff"
					style="height: 160rpx;border-radius: 16rpx;margin-bottom: 24rpx;"
				>
					<view class=" d-flex flex-c ali-i-c just-c">
						<text
							class="pf-sc fw-500"
							style="font-size: 34rpx;color: #262626;margin-bottom: 12rpx;"
						>
							￥{{ workUser.money }}
						</text>
						<text class="pf-sc fw-400" style="font-size: 26rpx;color: #262626;">当前余额</text>
					</view>
					<view class=" d-flex flex-c ali-i-c just-c">
						<text
							class="pf-sc fw-500"
							style="font-size: 34rpx;color: #262626;margin-bottom: 12rpx;"
						>
							￥{{ workUser.money }}
						</text>
						<text class="pf-sc fw-400" style="font-size: 26rpx;color: #262626;">累计收益</text>
					</view>
					<view class=" d-flex flex-c ali-i-c just-c">
						<text
							class="pf-sc fw-500"
							style="font-size: 34rpx;color: #262626;margin-bottom: 12rpx;"
						>
							{{ workUser.num }}
						</text>
						<text class="pf-sc fw-400" style="font-size: 26rpx;color: #262626;">累计服务</text>
					</view>
				</view>
				<!-- 3 -->
				<view
					class="w-100 d-flex flex-r ali-i-c just-ev bg-ff"
					style="border-radius: 16rpx;margin-bottom: 10rpx;"
				>
					<view class=" d-flex flex-c ali-i-c just-c" @click="GoMethod(1)">
						<image
							:src="require('@/static/icon/qianbao.png')"
							style="width: 44rpx;height: 44rpx;margin-bottom:11rpx"
						></image>
						<text class="pf-sc fw-400" style="font-size: 26rpx;color: #262626;">我的钱包</text>
					</view>

					<view class="d-flex flex-c ali-i-c just-c" @click="goTinajia">
						<image
							:src="require('@/static/tianjiama.png')"
							style="width: 44rpx;height: 50rpx;margin-bottom: 12rpx;"
						></image>
						<text class="fw-400 pf-sc" style="font-size: 28rpx;color: #262626;">提现账户</text>
					</view>
					<view class=" d-flex flex-c ali-i-c just-c" @click="GoMethod(2)">
						<image
							:src="require('@/static/icon/baobiao.png')"
							style="width: 32rpx;height: 40rpx;margin-bottom:20rpx"
						></image>
						<text class="pf-sc fw-400" style="font-size: 26rpx;color: #262626;">收益报表</text>
					</view>
					<view class=" d-flex flex-c ali-i-c just-c" @click="GoMethod(3)">
						<image
							:src="require('@/static/icon/mendian.png')"
							style="width:44rpx;height: 40rpx;margin-bottom:20rpx"
						></image>
						<text class="pf-sc fw-400" style="font-size: 26rpx;color: #262626;">申请合伙人</text>
					</view>
				</view>

				<view
					class="d-flex flex-r ali-i-c  bg-ff viewbox"
					style="height: 160rpx;border-radius: 16rpx;margin-bottom: 24rpx;width: 702rpx;justify-content: start;margin: 0 auto;padding-left: 54rpx;"
				>
					<view class=" d-flex flex-c ali-i-c just-c" @click="GoMethod(4)">
						<image
							:src="require('@/static/icon/suo.png')"
							style="width: 34rpx;height: 42rpx;margin-bottom:20rpx"
						></image>
						<text class="pf-sc fw-400" style="font-size: 26rpx;color: #262626;">修改密码</text>
					</view>
					<view class="d-flex flex-c ali-i-c just-c" @click="goUserlogin">
						<image
							:src="require('@/static/shifu.png')"
							style="width: 44rpx;height: 50rpx;margin-bottom: 12rpx;"
						></image>
						<text class="fw-400 pf-sc" style="font-size: 28rpx;color: #262626;">用户登录</text>
					</view>

					<view class="d-flex flex-c ali-i-c just-c" @click="GoShenLogin">
						<image
							:src="require('@/static/shen.png')"
							style="width: 44rpx;height: 50rpx;margin-bottom: 12rpx;"
						></image>
						<text class="fw-400 pf-sc" style="font-size: 28rpx;color: #262626;">年审人员登录</text>
					</view>
				</view>
			</view>
		</view>
		<!-- <login :loadModal="loadModal" @showlogin="showlogin" @hidelogin="hidelogin"></login> -->
	</view>
</template>

<script>
import login from '@/components/login';
import { usercenter, mycenter, txcode, vipdetail, getuserindex } from '@/common/api.js';
import {
	_tabContainerHeight,
	_screenHeight,
	_tabHeight,
	_addUnit,
	_rpxTpx,
	_navHeight,
	_statusBarHeight
} from '@/utils/GetSys.js';
export default {
	components: {
		login
	},
	data() {
		return {
			xxnum: '',
			loadModal: false,
			CurrentClient: uni.getStorageSync('CurrentClient'), //0:用户；1：师傅
			containerHeight: '',
			// //////////////////////////////////////
			// /////////////用户端/////////////////////////
			containerTop: '',
			userContainer: '',
			userInfo: '',
			user: uni.getStorageSync('workUser'),
			workUser: '',
			datainfo: ''
		};
	},
	methods: {
		//获取有没有新消息

		getindexconts() {
			getuserindex({ userid: uni.getStorageSync('userCent').id })
				.then(res => {
					console.log(res);
					if (res.data.code === 1) {
						this.xxnum = res.data.data.nums;
						console.log(this.xxnum);
					}
				})
				.catch(err => {});
		},

		//跳转到消息列表
		goMessage() {
			uni.navigateTo({
				url: '/userModelA/userA/Massage/Massage'
			});
		},
		//跳转到我的会员卡
		goMember() {
			uni.navigateTo({
				url: '/userModelA/userB/MembershipCard/MembershipCard'
			});
		},
		hidelogin(type) {
			console.log(type);
			this.loadModal = false;
			if (this.CurrentClient === 0) {
				//用户端
				this.getUser();
			}
		},
		// ////////////////用户端//////////////////////////////
		//点击开通会员跳转去首页
		goIndex() {
			uni.navigateTo({
				url: `/userModelA/userA/BuyMember/BuyMember?id=${3}`
			});
		},
		goUserlogin() {
			uni.showModal({
				title: '提示',
				content: '你确定要切换到用户端吗',

				success: function(res) {
					if (res.confirm) {
						uni.clearStorage();
						uni.reLaunch({
							url: '/pages/index/index'
						});
					} else if (res.cancel) {
						console.log('用户点击取消');
					}
				}
			});
		},
		GoShopOrder() {
			//跳转到用户订单
			uni.navigateTo({
				url: `/userModelA/userC/UserOrderList/UserOrderList`
			});
		},
		GoSetDataByUser() {
			//跳转到用户退出登录界面
			uni.navigateTo({
				url: `/userModelA/userB/SetDataByUser/SetDataByUser`
			});
		},
		GoRemainingSum() {
			//跳转到查看余额
			uni.navigateTo({
				url: `/userModelA/userB/RemainingSum/RemainingSum`
			});
		},
		GoVehicleManagement() {
			//跳转到车辆管理
			uni.navigateTo({
				url: `/userModelA/userB/VehicleManagement/VehicleManagement`
			});
		},
		GoMyCouPon() {
			//跳转到我的优惠券
			uni.navigateTo({
				url: `/userModelA/userB/MyCoupon/MyCoupon`
			});
		},
		GoRecharge() {
			//跳转到优惠充值
			uni.navigateTo({
				url: `/userModelA/userB/Recharge/Recharge`
			});
		},
		GoMembershipCard() {
			//跳转到我的会员卡
			uni.navigateTo({
				url: `/userModelA/userB/MembershipCard/MembershipCard`
			});
		},
		GoMyTeam() {
			//跳转到我的团队页面
			uni.navigateTo({
				url: `/userModelA/userB/MyTeam/MyTeam`
			});
		},
		GoShareRewards() {
			//跳转到分享奖励
			uni.navigateTo({
				url: `/userModelA/userB/ShareRewards/ShareRewards`
			});
		},
		GoAddressList() {
			//跳转到收货地址
			uni.navigateTo({
				url: `/userModelA/userB/AddressList/AddressList`
			});
		},
		GoShoppingCard() {
			//跳转到购物车
			uni.navigateTo({
				url: `/userModelA/userC/ShoppingCard/ShoppingCard`
			});
		},
		GoServiceOrder() {
			//跳转到服务订单
			uni.navigateTo({
				url: `/userModelA/userC/ServiceOrder/ServiceOrder`
			});
		},
		GoLogOn() {
			uni.navigateTo({
				url: '/staffModelA/staffB/LogOn/LogOn'
			});
		},
		GoShenQing() {
			uni.navigateTo({
				url: `/staffModelA/staffC/JoinTheStore/JoinTheStore?user=${'user'}`
			});
		},
		GoPartner() {
			uni.navigateTo({
				url: '/staffModelA/staffB/ParTner/ParTner'
			});
		},
		GoShenLogin() {
			if (uni.getStorageSync('AnnuallyUser').token) {
				uni.navigateTo({
					url: `/pages/AnnuallyIndex/AnnuallyIndex?type=${'user'}`
				});
			} else {
				uni.navigateTo({
					url: `/pages/AnnuallyLogin/AnnuallyLogin?type=${'user'}`
				});
			}
		},
		//用户端结束

		// ////////////////师傅端//////////////////////////////
		// ////////////////师傅端//////////////////////////////
		GoMethod(index) {
			switch (index) {
				case 1: //收益报表
					uni.navigateTo({
						url: `/staffModelA/staffC/Wallet/Wallet`
					});
					break;
				case 2: //收益报表
					uni.navigateTo({
						url: `/staffModelA/staffC/ReportForm/ReportForm`
					});
					break;
				case 3: //加入门店
					uni.navigateTo({
						url: `/staffModelA/staffC/JoinTheStore/JoinTheStore?user=${'worker'}`
					});
					break;
				case 4: //修改密码
					uni.navigateTo({
						url: `/staffModelA/staffC/SetPwd/SetPwd`
					});
					break;
				default:
					break;
			}
		},
		GoSetDataByStaff() {
			//跳转个人中心设置页面
			uni.navigateTo({
				url: `/staffModelA/staffC/SetDataByUser/SetDataByUser`
			});
		},
		//获取用户的个人信息
		getUser() {
			//发送请求渲染用户的个人信息
			let params = {
				token: uni.getStorageSync('usertoken')
			};
			usercenter(params).then(res => {
				// console.log(res.data.data);
				if (res.data.code === 1) {
					this.userInfo = res.data.data;
					uni.setStorageSync('userInfo', res.data.data);
				}
			});
		},
		//获取师傅的个人信息
		getWorkcenter() {
			let params = {
				token: uni.getStorageSync('user').token
			};
			mycenter(params).then(res => {
				// console.log(res.data.data);
				if (res.data.code == 1) {
					this.CurrentClient = 1;
					this.workUser = res.data.data;
					uni.setStorageSync('workUser', res.data.data);
				}
			});
		},
		goTinajia() {
			if (!this.datainfo.name && !this.datainfo.txcode) {
				uni.navigateTo({
					url: '/staffModelA/staffC/AddWithdrawalAccount/AddWithdrawalAccount'
				});
			} else {
				uni.navigateTo({
					url: '/staffModelA/staffC/WithdrawalAccount/WithdrawalAccount'
				});
			}
		},
		getindexcont() {
			txcode({
				token: uni.getStorageSync('user').token
			})
				.then(res => {
					// console.log(res, '我是用户端的');
					if (res.data.code === 1) {
						console.log(res, '哈哈哈哈');
						this.datainfo = res.data.data;
					}
				})
				.catch(err => {});
		}
	},
	onShow() {
		if (!uni.getStorageSync('userInfo')) {
			this.loadModal = true;
		}

		this.CurrentClient = uni.getStorageSync('CurrentClient');
		// console.log('home', uni.getStorageSync('CurrentClient'));
		const curPages = getCurrentPages()[0]; // 获取当前页面实例
		if (typeof curPages.getTabBar === 'function' && curPages.getTabBar()) {
			curPages.getTabBar().setData({
				selected: 3
			});
		}
		if (this.CurrentClient === 0) {
			//用户端
			this.getUser();
			this.getindexconts()
		}
		if (this.CurrentClient === 1) {
			//师傅端
			this.getWorkcenter();
			this.getindexcont();
		}
	},
	onLoad(Source) {
		this.containerHeight = _addUnit(_screenHeight() - _tabHeight(), 'px');
		this.containerTop = _addUnit(_navHeight() + _statusBarHeight(), 'px');
		this.userContainer = _addUnit(
			_screenHeight() - _navHeight() - _statusBarHeight() - _tabHeight(),
			'px'
		);
	}
};
</script>

<style lang="scss">
.user-center {
	.u-navbar--fixed {
		z-index: 30 !important;
	}
	.bg {
		height: 464rpx;
		background: linear-gradient(180deg, rgba(215, 239, 253, 0.53) 0%, #c1e8ff 100%);
	}
	.three {
		display: flex;
		justify-content: start;
		width: 100%;
		margin-left: 10rpx;
		view {
			width: 25%;
		}
	}
}
.viewbox > view {
	margin-right: 50rpx;
}
.viewbox > view:nth-child(2) {
	margin-right: 26rpx;
}
.viewbox > view:last-child {
	margin-right: 0;
}
</style>
